package com.example.Controller;

import com.example.Service.impl.LogServiceImpl;
import com.example.pojo.LogEntity;
import com.example.util.Result;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogServiceImpl logService;

    @GetMapping("/selectAllLogs")
    public Result selectAllLogs(@RequestParam(defaultValue = "1") Integer pageNum,
                                @RequestParam(defaultValue = "14") Integer pageSize,
                                @RequestParam(defaultValue = "") String startTime,
                                @RequestParam(defaultValue = "") String endTime) {
        PageInfo<LogEntity> pageInfo = logService.selectAllLogs(pageNum, pageSize, startTime, endTime);
        return new Result("200","查询成功",pageInfo);
    }


}
